# Maintainer: Balló György <ballogyor+arch at gmail dot com>

pkgname=gloobus-preview
_bzrrev=336
pkgver=0.4.5.$_bzrrev
pkgrel=6
pkgdesc="GNOME application designed to enable a full screen preview of any kind of file"
arch=('loong64' 'x86_64')
url="https://launchpad.net/gloobus-preview"
license=('GPL')
depends=('gst-plugins-base' 'gtksourceview3' 'poppler-glib' 'python-dbus' 'python-gobject')
makedepends=('boost' 'breezy' 'djvulibre' 'libgxps' 'libspectre')
optdepends=('djvulibre: Preview DjVu documents'
            'gst-libav: Extra media codecs'
            'gst-plugins-bad: Extra media codecs'
            'gst-plugins-good: Extra media codecs'
            'gst-plugins-ugly: Extra media codecs'
            'imagemagick: Support for more image formats'
            'libgxps: Preview XPS documents'
            'libspectre: Preview PostScript documents'
            'unoconv: Preview LibreOffice compatible documents')
source=("$pkgname::bzr+$url/trunk#revision=$_bzrrev")
sha256sums=('SKIP')

prepare() {
  cd $pkgname
  sed -i '/ACX_PTHREAD()/d' configure.ac
  autoreconf -vi
}

build() {
  cd $pkgname
  ./configure --prefix=/usr

  #https://bugzilla.gnome.org/show_bug.cgi?id=656231
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool

  make
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install
}
